/**
 * \file
 *          teleMainBL.h
 * \brief
 *          Implements starter of entTelematicsMain
 *
 * \par Author (last changes):
 *          - Song Yang
 *          - Phone +65 65800179
 *          - Continental Automotive Singapore
 * \par Project Leader:
 *          - Mandy Sin
 *          - Phone +65 67799 819
 *          - Mandy.Sin@continental-corporation.com
 * \par Responsible Developer:
 *          - Song Yang
 *          - Phone +65 65800179
 *          - Continental Automotive Singapore
 * \par Responsible Architect:
 *          - Goh Hoe Chun
 *          - Phone +65 67799 586
 *          - Hoe.Chun.Goh@continental-corporation.com
 *
 * \par Project:
 *      DPCA2
 *
 * \par SW-Component:
 *      teleMainBL
 *
 * \par SW-Package:
 *      Telematics Main
 *
 * \par SW-Module:
 *      Telematics Main
 *
 * \par SW-Architecture Specification:
 *      DPCA_SW_AD_IMX
 *      003
 *
 * \par SW-Design Specification:
 *      DPCA_your_module_SW_DD
 *      your_doc_number
 *
 * \par SW-Test Case Specification:
 *      DPCA_your_module_SW_TS
 *      your_doc_number
 *
 * \par CM-Info:
 *      - teleMainBL.h-1:incl:DPCARSgp#1
 *      - uidc1282
 *
 * \note
 *      This is a note.
 *
 * \bug
 *      - there are no known bugs
 *
 * \par Module-History:
 *
 * \verbatim
 * Date                Author                 Reason
 * 20 Dec 2012         Song Yang           Initial Creation
 * The latest entry at the head of the history list.
 * \endverbatim
 *
 * \par Copyright Notice:
 * Copyright (C) 2011 Continental Automotive Singapore Pte Ltd.
 * Alle Rechte vorbehalten. All Rights Reserved.\n
 * The reproduction, transmission or use of this document or its contents is
 * not permitted without express written authority.\n
 * Offenders will be liable for damages. All rights, including rights created
 * by patent grant or registration of a utility model or design, are reserved.
 *
 * \ingroup GEN_TELE_MAIN
 */

 #pragma once
 
 //==============================================================================
 // INCLUDES
 //==============================================================================
#include "ActiveClass.h"
#include "entITelematics_Def.h"

//==============================================================================
// PROTOTYPES
//==============================================================================
 class teleGenHMIMsgHandler;

 /**
  * \class   teleMainBL
  * \brief    Main class of Telematics BL, provide RPC call capability.
  */
 class teleMainBL : public ActiveClass {
     ////    Constructors and destructors    ////
 private:
     /// Constructors
     teleMainBL();
     
    typedef struct S_DATA_POOL_t{
        E_CONN_STATUS connStatus;
        E_DEV_STATUS devStatus;
        S_TLM_NET_STATUS netStatus;
    } S_DATA_POOL;
    
 public :

     /// destructors
     virtual ~teleMainBL();
     
     void initialize();
 
     /// operation getInstance()
     static teleMainBL& getInstance();
 
 ////    Operations    ////
 public :
 
 /// Telematics method:
 
     /// Generic HMI
     /// operation GenHMI_SetAlertPopupStatus()
     void GenHMI_SetAlertPopupStatus(LPVOID inBuffer, uint8_t inBufferSize);
 
     /// operation __GenHMI_SetAlertPopupStatus
     void __GenHMI_SetAlertPopupStatus(LPVOID inBuffer, uint8_t inBufferSize);

    void GenHMI_SetQuestionPopupStatus(LPVOID inBuffer, uint8_t inBufferSize);
    void __GenHMI_SetQuestionPopupStatus(LPVOID inBuffer, uint8_t inBufferSize);
    
    void GenHMI_SetListPopupStatus(LPVOID inBuffer, uint8_t inBufferSize);
    void __GenHMI_SetListPopupStatus(LPVOID inBuffer, uint8_t inBufferSize);
    
    void GenHMI_PostATBMessage(LPVOID inBuffer = NIL, uint8_t inBufferSize = 0);
    void __GenHMI_PostATBMessage(LPVOID inBuffer = NIL, uint8_t inBufferSize = 0);

    //VIN Conflict
    void Admin_DetectVINConflict(E_VIN_TRIGGER);
    void __Admin_DetectVINConflict(LPVOID inBuffer = NIL, uint8_t inBufferSize = 0);

    ///Data Pool Interface
    void setDataConnStatus(const E_CONN_STATUS &);

    void setNetworkStatus(const S_TLM_NET_STATUS &);

    void setDevStatus(const E_DEV_STATUS &);

    void getDataConnStatus(E_CONN_STATUS *);

    void getNetworkStatus(S_TLM_NET_STATUS *);

    void getDevStatus(E_DEV_STATUS *);
    
 protected :
     /// operation __SyncCall(RPC_IOCTL_PTR)
     virtual void __SyncCall(RPC_IOCTL_PTR p);
 
     /// operation __AsyncCall(RPC_IOCTL_PTR)
     virtual void __AsyncCall(RPC_IOCTL_PTR p);

     void sendAsyncRpcCall(uc8_t, LPVOID, uint8_t, LPVOID = NIL, uint8_t = 0);
     
     ////    Attributes    ////
 protected :
        CRITICAL_SECTION mCSDataPoolWR;
        S_DATA_POOL mDataPool;
 };


